package com.teach.javafxclient.controller.base;


import com.teach.javafxclient.MainApplication;
import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.TabPane;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;

import java.io.IOException;

public class AcademicPerformanceItemController {
    @FXML
    public Label Name;
    @FXML
    private Label teacherName;
    @FXML
    private Label credit;
    @FXML
    private Label termName;
    @FXML
    private Label endText;
    @FXML
    private VBox mainPage;
    @FXML
    private Pane innerPage;
    @FXML
    private AnchorPane pageRoot;
    private TabPane tabNode;
    private FXMLLoader tabLoader;
    private TabPaneController tabC;
    @FXML
    public VBox subContent;

    public void setItem(String coursename, String teachername, String singlecredit, String termname, Boolean ended, String finalScore){
        Name.setText(coursename);
        teacherName.setText(teachername);
        credit.setText(singlecredit);
        termName.setText(termname);
        if(ended){
            //已经结课
            mainPage.setStyle("-fx-background-color:#cdf3c6;-fx-background-radius: 20;-fx-border-radius:10");
            endText.setText(finalScore);
            endText.setStyle("-fx-background-color:#690c09");
        }else{
            mainPage.setStyle("-fx-background-color:#d5e9ff;-fx-background-radius: 20");
            innerPage.setStyle("-fx-background-color:#cdf3c6;-fx-border-color: #647062;-fx-background-radius:10;-fx-border-radius:10");
            endText.setText("进行中");
        }
    }

}
